

module("Logger", package.seeall)

function log_(logfile, ...)
    local info = nil
    for i, v in ipairs({...}) do
        if not info then
           info = v
        else
           info = info..","..v
        end
    end
    if not info then
        info = "\n"
    else
        info = info.."\n"
    end
    require("File").Append(logfile, info)
 end

 function newlogger(file)
    local logger = {}
    logger.file = file or "/tmp/log.log"
    logger.log = function(...) log_(logger.file, ...) end
    return logger
 end
